package com.myk.game.gobangchess.rooms.oldrooms;

import com.myk.game.gobangchess.constants.BoardStyleData;
import com.myk.game.gobangchess.Room;
import com.myk.game.gobangchess.signs.*;
import com.myk.game.gobangchess.utils.Pair;

import java.util.ArrayList;
import java.util.List;

/**
 * 标记查看测试房间
 */
public class SignsWatchRoom extends Room {

    public SignsWatchRoom(String roomName) {
        super(roomName, "专门用于展示特殊标记组合的房间","标记展示柜", BoardStyleData.getGoBangStyle(15,15), false,false);
        initFigureSigns0();
        //initFigureSigns1();
        //initFigureSigns2();
        //initBadgeSigns();
        //initTitleSign();
        //initPathSign();
        //initAroundSign();
    }

    private void initAroundSign() {
        List<Integer> ids = getIndexes(
                getIndex(2,3),
                getIndex(3,2),
                getIndex(5,2),
                getIndex(5,4),
                getIndex(5,6),
                getIndex(3,4),
                getIndex(3,5),
                getIndex(4,2),
                getIndex(4,6),
                getIndex(7,5),
                getIndex(7,4),
                getIndex(7,3),
                getIndex(6,2),
                getIndex(6,6),
                getIndex(12,12)
        );
        signList.add(new AroundSign(ids, "#88AAFF55", "#FFFF55FF", 3f));
    }

    private void initPathSign() {
        List<Pair<Integer, Integer>> nodes = new ArrayList<>();
        nodes.add(new Pair<>(getIndex(0, 0), 0)); //左上角
        nodes.add(new Pair<>(getIndex(3, 13), 4)); //中间
        nodes.add(new Pair<>(getIndex(6, 8), 8)); //右下角
        nodes.add(new Pair<>(getIndex(0, 6), 3)); //左边
        nodes.add(new Pair<>(getIndex(11, 4), 1)); //上边
        nodes.add(new Pair<>(getIndex(8, 4), 5)); //右边
        nodes.add(new Pair<>(getIndex(9, 12), 6)); //左下角
        nodes.add(new Pair<>(getIndex(14, 14), 7)); //下边
        nodes.add(new Pair<>(getIndex(2, 4), 2)); //右上角
        signList.add(new PathSign(nodes, "#FFFF3388", "#33FF8888", 4f, 1));
    }

    private void initTitleSign() {
//        signList.add(new TitleSign(0.5f,0.1f,0,"居中抬头文字","#FFFF33FF",1f));
//        signList.add(new TitleSign(0.5f,0.5f,0,"完全居中的文字","#FFFF33FF",1f));
//        signList.add(new TitleSign(0f,0.7f,2,"左对齐的文字","#FFFF33FF",1.5f));
//        signList.add(new TitleSign(0f,0f,3,"向下延申的文本","#FFFF33FF",1.5f));
    }

    private void initBadgeSigns() {
        signList.add(new BadgeSign(getIndex(3, 3), "0", 0, "#99BB33", "#FFAA77AA"));
        signList.add(new BadgeSign(getIndex(3, 3), "1", 1, "#99BB33", "#FFAA77AA"));
        signList.add(new BadgeSign(getIndex(3, 3), "2", 2, "#99BB33", "#FFAA77AA"));
        signList.add(new BadgeSign(getIndex(3, 3), "3", 3, "#99BB33", "#FFAA77AA"));
        signList.add(new BadgeSign(getIndex(3, 3), "4", 4, "#99BB33", "#FFAA77AA"));
        signList.add(new BadgeSign(getIndex(3, 3), "5", 5, "#99BB33", "#FFAA77AA"));
        signList.add(new BadgeSign(getIndex(3, 3), "6", 6, "#99BB33", "#FFAA77AA"));
        signList.add(new BadgeSign(getIndex(3, 3), "7", 7, "#99BB33", "#FFAA77AA"));
        signList.add(new BadgeSign(getIndex(3, 3), "G", 8, "#99BB33", "#FFAA77AA"));
        curGrids[3][3] = 2;
    }

    private void initFigureSigns0() {
        List<Pair<Integer, Integer>> tiles = new ArrayList<>();
        tiles.add(new Pair<>(getIndex(0, 0), getIndex(2, 3)));
        tiles.add(new Pair<>(getIndex(4, 4), getIndex(6, 5)));
        tiles.add(new Pair<>(getIndex(5, 1), getIndex(5, 1)));
        FigureSign figureSign = new FigureSign(tiles, "#FFFF3333");
//        figureSign.setMidSideLine(1, 1, 1, 1, 1, 1, 1, 1);
        figureSign.setMidCenLine(1, 1, 1, 1);
//        figureSign.setCorCenLine(1, 1, 1, 1);
//        figureSign.setAdjMidLine(1, 1, 1, 1);
//        figureSign.setCorMidLine(1, 1, 1, 1, 1, 1, 1, 1);
//
//        figureSign.setCompCenArc(1, 1, 1, 1);
//        figureSign.setCenExpArc(1, 1, 1, 1, 1, 1, 1, 1);
//        figureSign.setCorExpArc(1, 1, 1, 1);
//        figureSign.setCorCenArc(1, 1, 1, 1);
//        figureSign.setSideExpArc(1, 1, 1, 1, 1, 1, 1, 1);
//        figureSign.setCorMidArc(1, 1, 1, 1, 1, 1, 1, 1);

        figureSign.setCompPoint(1, 1, 1, 1, 1, 1, 1, 1, 1);

        signList.add(figureSign);
    }

    private void initFigureSigns1() {
        List<Pair<Integer, Integer>> tiles = new ArrayList<>();
        tiles.add(new Pair<>(getIndex(0, 0), getIndex(2, 3)));
        tiles.add(new Pair<>(getIndex(4, 4), getIndex(6, 5)));
        tiles.add(new Pair<>(getIndex(5, 1), getIndex(5, 1)));
        FigureSign figureSign = new FigureSign(tiles, "#FFFF3333");
//        figureSign.setMidSideLine(1, 0, 1, 0, 1, 0, 1, 0);
//        figureSign.setMidCenLine(1, 0, 1, 0);
//        figureSign.setCorCenLine(1, 0, 1, 0);
//        figureSign.setAdjMidLine(1, 0, 1, 0);
//        figureSign.setCorMidLine(1, 0, 1, 0, 1, 0, 1, 0);

//        figureSign.setCompCenArc(1, 0, 1, 0);
//        figureSign.setCenExpArc(1, 0, 1, 0, 1, 0, 1, 0);
//        figureSign.setCorExpArc(1, 0, 1, 0);
//        figureSign.setCorCenArc(1, 0, 1, 0);
//        figureSign.setSideExpArc(1, 0, 1, 0, 1, 0, 1, 0);
//        figureSign.setCorMidArc(1, 0, 1, 0, 1, 0, 1, 0);

        //figureSign.setCompPoint(1, 1, 1, 1, 1, 1, 1, 1, 1);

        signList.add(figureSign);
    }

    private void initFigureSigns2() {
        List<Pair<Integer, Integer>> tiles = new ArrayList<>();
        tiles.add(new Pair<>(getIndex(0, 0), getIndex(2, 3)));
        tiles.add(new Pair<>(getIndex(4, 4), getIndex(6, 5)));
        tiles.add(new Pair<>(getIndex(5, 1), getIndex(5, 1)));
        FigureSign figureSign = new FigureSign(tiles, "#FFFF3333");
//        figureSign.setMidSideLine(1, 1, 1, 1, 0, 0, 0, 0);
//        figureSign.setMidCenLine(1, 1, 0, 0);
//        figureSign.setCorCenLine(1, 1, 0, 0);
//        figureSign.setAdjMidLine(1, 1, 0, 0);
//        figureSign.setCorMidLine(1, 1, 1, 1, 0, 0, 0, 0);

//        figureSign.setCompCenArc(1, 1, 0, 0);
//        figureSign.setCenExpArc(1, 1, 1, 1, 0, 0, 0, 0);
//        figureSign.setCorExpArc(1, 1, 0, 0);
//        figureSign.setCorCenArc(1, 1, 0, 0);
//        figureSign.setSideExpArc(1, 1, 1, 1, 0, 0, 0, 0);
        figureSign.setCorMidArc(1, 1, 1, 1, 0, 0, 0, 0);

        //figureSign.setCompPoint(1, 1, 1, 1, 1, 1, 1, 1, 1);

        signList.add(figureSign);
    }

    @Override
    public String getRuleText() {
        return null;
    }

    @Override
    public void doRule(int row, int col, int value) {

    }
}
